package com.wbb.service.impl;

import com.wbb.mapper.TbSellerMapper;
import com.wbb.model.TbSeller;
import com.wbb.model.TbSellerExample;
import com.wbb.service.SellerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SellerServiceImpl implements SellerService {
    @Autowired
    private TbSellerMapper sellerMapper;

    @Override
    public TbSeller queryByUsername(String username) {
        TbSellerExample example = new TbSellerExample();
        example.createCriteria().andSellerIdEqualTo(username);
        List<TbSeller> tbSellers = sellerMapper.selectByExample(example);
        return (tbSellers == null || tbSellers.isEmpty()) ? null : tbSellers.get(0);
    }
}
